<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .father {
      width: 600px;
      height: 600px;
      background-color: pink;
      line-height: 600px;
      text-align: center;
    }

    img {
      vertical-align: middle;
    }
  </style>
</head>
<body>
  <!-- 使用line-height标签让img标签垂直居中问题 -->
  <!-- 默认图片底部和文字的基线对齐，所以这里要加上vertical-align: middle;垂直对齐方式才能居中 -->
  <div class="father">
    <img src="./07案例.jpg" alt="">yyy
  </div>
</body>
</html>